home *** CD-ROM | disk | FTP | other *** search
/ Whiteline: Alpha / Whiteline Alpha.iso / tools / prtfolio / pbasic.adr < prev    next >
Encoding:
Text File  |  1994-09-22  |  13.3 KB  |  759 lines

  1. ABS(exp)
  2. Returns absolute value of exp.
  3.  
  4. ACOS(exp)
  5. Returns the arc cosine of exp.
  6.  
  7. ADDRESS of BJ Gleason
  8. The American University
  9. CSIS  (Thin Air Labs)
  10. 4400 Massachusetts Avenue, N.W.
  11. Washington, DC  20016
  12. Compuserve : 75300,2517
  13. EMAIL : bjgleas@auvm.american.edu
  14.  
  15. ALARM
  16. Beep speaker, Wait for keypress.
  17. PORT ONLY
  18.  
  19. ALTR.COM
  20. TSR to invoke P.EXE from editor
  21. <ALT><R> to Execute
  22.  
  23. ARGC
  24. Returns the number of command line
  25. paramters
  26.  
  27. ARGV$(x)
  28. Returns the xth command line
  29. parameter
  30.  
  31. ASC(x$)
  32. Returns ASCII value of the first
  33. character in x$.
  34.  
  35. ASIN(exp)
  36. Returns the arc sine of exp.
  37.  
  38. ATN(exp)
  39. Returns Arc Tangent of exp.
  40.  
  41. BEEP
  42. Single beep from the speaker.
  43. PORT ONLY
  44.  
  45. BIN$(n)
  46. Converts n to a binary string.
  47.  
  48. BLOAD filename, offset
  49. Load Binary file to SEG:offset.
  50.  
  51. BOX row1, col1, row2, col2, type
  52. Draw a box.  Row1 and Col1 specify the
  53. upper left corner position of the box,
  54. Row2 and Col2 specify the lower right.
  55. Type 0 for single line, 1 for a double
  56. PORT ONLY
  57.  
  58. BREAK - Atari key (/|\)
  59.  
  60. BSAVE filename, offset, length
  61. Save binary image of length bytes at
  62. SEG:offset to filename.
  63.  
  64. CALL address
  65. Transfer control to SEG:address.
  66.  
  67. CALL INTERRUPT intnum
  68. Invoke DOS interrupt intnum.
  69.  
  70. CEIL(x)
  71. Rounds x up
  72.  
  73. CHAIN filename
  74. Load and execute filename.BAS.  All
  75. variables are preserved.
  76.  
  77. CHARPTR
  78. Return address of ASCII Characters
  79.  
  80. CHDIR pathname
  81. Change directory to pathname.
  82.  
  83. CHR$(n)
  84. Returns ASCII char of the value n.
  85.  
  86. CLICK
  87. Make the key click sound.
  88. PORT ONLY
  89.  
  90. CLOSE #fileno
  91. Close a file.
  92.  
  93. CLS
  94. Clears the screen.
  95.  
  96. CMODE =c
  97. Set Character Mode in graphics print
  98. Bits:
  99.     0 Underline    +1
  100.     1 Reverse    +2
  101.     2 Wide        +4
  102.     3 UpsideDown    +8
  103.     4 Sideways    +16
  104.     5 Double Height    +32
  105.     6 Half Height    +64
  106.     7 Half Width    +128
  107.     8 OR bits    +256
  108.     9 XOR bits    +512
  109.  
  110. COMIN
  111. Returns the ASCII value of the
  112. character from the serial port.
  113.  
  114. COMMAND$
  115. Return the command line that started
  116. PBASIC.
  117.  
  118. COMOUT = val
  119. Send val to serial port
  120.  
  121. COMSET = config
  122. Send config byte to init serial port
  123.  
  124. COMSTAT
  125. Returns the status of the serial
  126. port.
  127.  
  128. COSH(exp)
  129. Returns hyperbolic cosine of exp.
  130.  
  131. COS(exp)
  132. Returns cosine of exp.
  133.  
  134. CSRLIN
  135. Returns current cursor line.
  136.  
  137. CWD$
  138. Returns Current Working Directory
  139.  
  140. DATA list of numbers/strings
  141. MUST have a line number.
  142. Elements separted by commas
  143. Strings must be enclosed in quotes.
  144. 12 DATA 1,2,3,4,5,6
  145.  
  146. DATE$
  147. Returns system date.
  148.  
  149. DECR(n)
  150. Decrement n by 1.
  151.  
  152. DEF fname(params)=expression
  153. Create numeric function called fname
  154.  
  155. DEF SEG   = exp
  156. Assigns a segment address for memory
  157. accessing via PEEK, POKE and CALL.
  158.  
  159. DEG(exp)
  160. Convert radians to degrees.
  161.  
  162. DIAL string
  163. Dial the "number" through the speaker.
  164. Valid tones are: 0 1 2 3 4 5 6 7 8
  165. 9 A B C D * #.
  166. PORT ONLY
  167.  
  168. DIM var(size,[size]){,var(size)}
  169. Dimension Float or String Arrays
  170.  
  171. DISPLAY   exp
  172. 0=Static, 1=Normal, 2=Tracked
  173. PORT ONLY
  174.  
  175. DMS(exp)
  176. Convert degrees to degree.minsec
  177.  
  178. DOSVER
  179. Return current version of DOS
  180.  
  181. EDITOR
  182. Name PBASIC.EXE P.EXE
  183. Returns to Editor on Error
  184.  
  185. EDIT$("title,b$)
  186. Opens window, edits B$, returns
  187. edited string.  B$ is unchanged.
  188.  
  189. END
  190.  
  191. EOF(fileno)
  192. Test for End of File.
  193.  
  194. ERADR
  195. Returns address of Error
  196.  
  197. ERL
  198. Returns the linenumber of the last
  199. error.
  200.  
  201. ERMSG$
  202. Returns message string of last
  203. error
  204.  
  205. ERR
  206. Returns the error number of the last
  207. error.
  208.  
  209. ERROR errnum
  210. Simulate Error.
  211.  
  212. ERRORLEVEL
  213. Code generated upon exit.
  214. 0 - Successful exit
  215. 1 - Program aborted
  216. 2 - STOP encountered
  217.  
  218. ERRWIN row, col, "message"
  219. Display message at row, col.  Beep and
  220. wait for keypress.
  221. PORT ONLY
  222.  
  223. EVAL x$
  224. Evaluate x$ as part of a PBASIC program.
  225. x$ MUST be a string variable.
  226.  
  227. EXISTS(fn$)
  228. Returns TRUE if file fn$ exists
  229.  
  230. EXITCMD x$
  231. Exit PBASIC, place x$ in keyboard
  232. buffer.
  233.  
  234. EXITCODE x
  235. Exit PBASIC, set ERRORLEVEL to x
  236.  
  237. EXP(exp)
  238. Returns e to the power of exp.
  239.  
  240. FALSE
  241. Returns 0.
  242.  
  243. FINDFILE$(pat$)
  244. Returns name of file matching pat$
  245.  
  246. FINDNEXT$
  247. Returns next name of file matching
  248. pat$ from FINDFILE$.
  249.  
  250. FIX(exp)
  251. Returns integer portion of exp.
  252.  
  253. FORMFEED
  254. Send a formfeed to the printer.
  255.  
  256. FOR var = exp TO exp [STEP exp]
  257.  
  258. FREEFILE
  259. Returns free file number
  260.  
  261. FRE(exp)
  262. Returns free amount of memory.
  263. Parameter exp is a dummy expression.
  264.  
  265. GETDISPLAY
  266. Returns the current display
  267. mode.  See DISPLAY for details.
  268. PORT ONLY
  269.  
  270. GLOCATE x,y
  271. Set graphics cursor to x,y
  272.  
  273. GOSUB line number
  274.  
  275. GOTO line number
  276.  
  277. GPRINT "xx";&h03,etc
  278. Graphics Print.  Print Bit Pattern
  279. from HEX numbers.  (,) will skip
  280. one column.
  281.  
  282. HEX$(n)
  283. Converts n to a hexidecmial string.
  284.  
  285. IF exp THEN stmt [ ELSE stmt ]
  286.  
  287. INCR(n)
  288. Increment n by 1.
  289.  
  290. INKEY$
  291. If a key is pressed, char is returned,
  292. otherwise, the empty string ("").
  293.  
  294. INPUT #fileno, varname [,varname...]
  295. Read data from a file.
  296.  
  297. INPUT$(n,#fileno)
  298. Return n character from #fileno.
  299.  
  300. INPUT ["prompt" (,|;)] varname
  301. [,] no ?, [;] ? is printed
  302.  
  303. INP(port)
  304. Returns byte value from port.
  305.  
  306. INSTAT
  307. Returns TRUE if key pressed.
  308.  
  309. INSTR(x$,y$)
  310. Returns position of y$ in x$.
  311.  
  312. INT(exp)
  313. Returns integer portion of exp.
  314.  
  315. INVERT
  316. Invert the graphics screen
  317.  
  318. ISALTR
  319. Return TRUE if ALTR is loaded,
  320. otherwise FALSE.
  321.  
  322. ISRUN
  323. Returns TRUE if program was executed
  324. by by the RUN command, otherwise
  325. FALSE.
  326.  
  327. KILL filename
  328. Delete filename from disk.
  329.  
  330. LCASE$(x$)
  331. Returns the lower case version of x$.
  332.  
  333. LEFT$(x$,n)
  334. Returns leftmost n characters of x$.
  335.  
  336. LEN(x$)
  337. Returns the length of x$.
  338.  
  339. LINE (x,y)-(x2,y2),c[,B[F]]
  340. Draw line from x,y to x2,y2, color c.
  341. Option B, make it a box, F fill box
  342.  
  343. LOCATE row,col[,cur]
  344. Move the cursor to row, col.
  345. 1,1 is top left.
  346. cur = 0-off, 1-underline, 2-block
  347.  
  348. LOG(exp)
  349. Returns natural log of exp.
  350.  
  351. LPCHR$(x)
  352. Send ASCII value x to printer
  353.  
  354. LPOS(exp)
  355. Returns position of line printer head.
  356. Exp is a dummy expression.
  357.  
  358. LPRINT list of expressions
  359. Send output to printer.  See PRINT.
  360.  
  361. LTRIM$(n$)
  362. Returns n$ with no leading spaces.
  363.  
  364. MENU(row, col, display, topline, selected, elements, "Title",entries)
  365. Display menu, result%256=entry, result\256=topline
  366. Display is number of elements to show
  367. Topline is element at top
  368. Selected is cursor element
  369. Element is number of entries + title
  370. If elements is <0 then use Array Mode
  371.  
  372. MID$(a$,n[,m])=b$
  373. Characters in a$ from n for length m
  374. are replaced by b$
  375.  
  376. MID$(x$,n,m)
  377. Returns string from x$, starting at
  378. position n for m characters.
  379.  
  380. MKDIR pathname
  381. Make a directory called pathname.
  382.  
  383. MSD(exp)
  384. Convert Degrees.minsec to degrees.
  385.  
  386. NEXT [var]
  387.  
  388. NUMFMT = "format"
  389. Default number format.  "% g " for GWBASIC.
  390. "%e" scientific.
  391.  
  392. OCT$(n)
  393. Converts n to an Octal string.
  394.  
  395. OFF
  396. Tunr off until keypress.
  397. PORT ONLY
  398.  
  399. ON ERROR GOTO line number
  400. Transfer to line number on error.
  401.  
  402. ON ERROR GOTO 0
  403. Disable error trapping.
  404.  
  405. ON exp  GOSUB list of line numbers
  406.  
  407. ON exp  GOTO  list of line numbers
  408.  
  409. OPEN "mode", fileno, filename
  410. Opens a file for access.  "mode" is "I" input,
  411. "O" output, and "A" append.
  412.  
  413. OUT port, exp
  414. Send value to the indicated port.
  415.  
  416. PASSWORD$
  417. Allows user to enter 8 characters
  418. as a password
  419.  
  420. PBASIC filename.ext [-T] [-E]
  421. Use filename.ext
  422. Default .ext is .BAS
  423. -T turns on Line Trace
  424. -E Portfolio Emulation, need I60/I61
  425.  
  426. PBASIC [-T] [-E]
  427. Use last file you were editing
  428. -T turns on Line Trace
  429. -E Portfolio Emulation needs I60/I61
  430.  
  431. PBVER
  432. Returns the version number of PBASIC.
  433.  
  434. PEEK(address)
  435. Returns byte from SEG:address.
  436. SEG is set via DEF SEG.
  437.  
  438. PGLOAD filename
  439. Load a .PGC file into screen memory.
  440.  
  441. PGSAVE filename
  442. Save screen memory as a .PGC file.
  443.  
  444. PGSHOW filename, delay
  445. Load and Display a .PGC file.  Delay
  446. is seconds, 0 is a keypress.
  447.  
  448. PI
  449. Returns 3.14159.
  450.  
  451. POINT(row,col)
  452. Returns value of pixel at row,col.
  453.  
  454. POKE addr, exp
  455. Places value at SEG:addr. SEG is set via
  456. the DEF SEG statement.  If you are doing
  457. Video Memory, use REFRESH.
  458.  
  459. PORT
  460. Returns a 1 if running on a Portfolio,
  461. 0 if not.
  462.  
  463. Portfolio BASIC, version 4.9
  464. (c) 1991 BJ Gleason
  465. by BJ Gleason, American University
  466.  
  467. POS(exp)
  468. Returns the current cursor column.
  469. Exp is a dummy expression.
  470.  
  471. PRINTER
  472. All PRINT to the printer
  473. Will not wrap the output lines
  474.  
  475. PRINT #fileno, list of expressions
  476. Write data to a file.
  477.  
  478. PRINT #fileno, USING "format", list of exp
  479. Write formatted data to file.
  480. "%7.2f" is two digits after decimal point
  481.  
  482. PRINT[@l,] list of expressions
  483. [,] to tab, [;] or [ ]
  484. @l moves to position 0-319
  485.  
  486. PRINT[@l,] USING "format"; list of exp
  487. Display exp in format.  "%e" is scientific.
  488. "%.0f" is integer.
  489. @l moves to position 0-319
  490.  
  491. PROGLOC
  492. Returns address of BASIC code
  493.  
  494. PRTSC
  495. Send copy to screen to printer
  496.  
  497. PSET(row, col) [, exp]
  498. Set the pixel at row, col to exp.
  499. Port has mximum of 64x240
  500. Exp can be 0 (off) or 1 (on).
  501.  
  502. RAD(exp)
  503. Convert degrees to radians.
  504.  
  505. RANDOMIZE
  506. Initialize the random number generator.
  507.  
  508. RAND(exp)
  509. Return a number between 0 and exp-1.
  510.  
  511. READ list of variables
  512. Read the values of the variables from
  513. DATA statements.
  514.  
  515. REFRESH
  516. Copy video memory to the LCD controller
  517. PORT ONLY
  518.  
  519. REG rn, value
  520. Sets rn to value.  rn: 0=Flags, 1=AX,
  521. 2=BX, 3=CX, 4=DX, 5=SI, 6=DI
  522.  
  523. REG(rn)
  524. Returns rn value. rn: 0=Flags, 1=AX,
  525. 2=BX, 3=CX, 4=DX, 5=SI, 6=DI
  526.  
  527. REM
  528. Remark.  The rest of line is ignored.
  529. You can also use the quote (') mark
  530.  
  531. REPEAT ... UNTIL exp
  532. Repeat until exp is TRUE.
  533.  
  534. RESTORE [line number]
  535. Sets data pointer to the specified
  536. line number.  If no line number is
  537. given, point to first data location.
  538.  
  539. RESUME line number
  540. Resume at line number after an error.
  541.  
  542. RETURN
  543.  
  544. REVERSE$(x$)
  545. Returns x$ reversed.
  546.  
  547. RIGHT$(x$,n)
  548. Returns rightmost n characters from x$.
  549.  
  550. RMDIR pathname
  551. Remove an empty directory from disk.
  552.  
  553. RND
  554. Return an number between 0 and 1.
  555.  
  556. ROMVER
  557. Return the version number of the ROM.
  558. PORT ONLY
  559.  
  560. RTRIM$(n$)
  561. Returns n$ with no trailing spaces.
  562.  
  563. RUN filename
  564. Load and execute filename.BAS.  All
  565. variables are lost.
  566.  
  567. SCREEN
  568. Returns the current screen mode
  569.  
  570. SCREEN exp
  571. 4   graphics  320x200
  572. 5   graphics  320x200
  573. 6   graphics  640x200
  574. 7   text      80x25
  575. 8   graphics  160x200
  576. 10   graphics  640x200
  577.  
  578. SCRLOAD n$(x)
  579. Load text screen from string array.
  580.  
  581. SCRSAVE n$(x)
  582. Save text screen to string array.  Each
  583. screen requires two strings a(0), a(1)
  584.  
  585. SGN(exp)
  586. Returns the sign of exp.
  587.  -1   exp < 0
  588.   0   exp = 0
  589.   1   exp > 0
  590.  
  591. SHIFT
  592. Returns status of the shift keys
  593.  
  594. SHIFT = x
  595. Set the shift mode, see SHIFT
  596.  
  597. SINH(exp)
  598. Returns hyperbolic sine of exp.
  599.  
  600. SIN(exp)
  601. Returns sine of exp.
  602.  
  603. SOUND code, duration
  604. Duration is length of tone in 10 msec.
  605. PORT ONLY
  606. CODE      NOTE      Frequency (Hz)
  607. 48        D#5       622.3
  608. 49        E5        659.3
  609. 50        F5        698.5
  610. 51        F#5       740.0
  611. 52        G5        784.0
  612. 53        G#5       830.6
  613. 54        A5        880.0
  614. 55        A#5       932.3
  615. 56        B5        987.8
  616. 57        C6        1046.5
  617. 58        C#6       1108.7
  618. 41        D6        1174.7
  619. 59        D#6       1244.5
  620. 60        E6        1318.5
  621. 61        F6        1396.9
  622. 14        F#6       1480.0
  623. 62        G6        1568.0
  624. 44        G#6       1661.2
  625. 63        A6        1760.0
  626.  4        A#6       1864.7
  627.  5        B6        1975.5
  628. 37        C7        2093.0
  629. 47        C#7       2217.5
  630.  6        D7        2349.3
  631.  7        D#7       2489.0
  632.  
  633. SPACE$(n)
  634. Returns a string of n spaces.
  635.  
  636. SPC(n)
  637. Returns a string of n spaces.
  638.  
  639. SQR(exp)
  640. Returns Square Root of exp.
  641.  
  642. SSIZE=n
  643. Set default String Size
  644. Default = 256
  645.  
  646. STATUS exp
  647. Enable or disable the Status line.
  648. 0 for off, 1 for on.
  649. PORT ONLY
  650.  
  651. STOP
  652. Terminate and Display Line number.
  653. Point editor to location.
  654.  
  655. STRING$(n,m)
  656. Returns a string composed of n chars.
  657. The ASCII value of the character is m.
  658.  
  659. STR$(n)
  660. Returns string representation of n.
  661.  
  662. SWAP varname, varname
  663. Exchange contents of the two vars.
  664.  
  665. SYSTEM
  666. Terminate the program.
  667.  
  668. TAB(n)
  669. In PRINT, move to column n.
  670.  
  671. TANH(exp)
  672. Returns hyperbolic tangent of exp.
  673.  
  674. TAN(exp)
  675. Returns tangent of exp.
  676.  
  677. TICK exp
  678. Sets the Clock tick speed.
  679. 0 is Normal, 1 tick every 128 seconds.
  680. 1 is Fast, 1 tick every second.
  681. PORT ONLY
  682.  
  683. TIMER
  684. Returns number of seconds since midnight.
  685.  
  686. TIME$
  687. Returns the system time.
  688.  
  689. TROFF
  690. Disable line tracing.
  691.  
  692. TRON
  693. Enable line tracing.
  694.  
  695. TRUE
  696. Returns -1.
  697.  
  698. UCASE$(x$)
  699. Returns the Uppercase version of x$
  700.  
  701. VAL(x$)
  702. Returns the numeric value of x$.
  703.  
  704. VARPTR(x)
  705. Returns the location of variable x.
  706.  
  707. VARSEG(x)
  708. Returns the segment of variable x.
  709.  
  710. VCSRLIN
  711. Returns the current virtual cursor line.
  712. PORT ONLY
  713.  
  714. VLOCATE row,col
  715. Move the virtual cursor to row, col.
  716. This location is position 1,1 on the
  717. physical screen.
  718. PORT ONLY
  719.  
  720. VMOVE dir, dis
  721. Move screen in direction dir, dis
  722. number of characters. Works only
  723. in Static and Tracked modes.
  724. 1=Up,2=Down,3=Left,4=Right.
  725. PORT ONLY
  726.  
  727. VPOS(exp)
  728. Returns current virtual cursor column.
  729. Exp is a dummy expression.
  730. PORT ONLY
  731.  
  732. WAIT
  733. Wait for a keypress.
  734.  
  735. WHILE exp ... WEND
  736. Execute statements while exp is TRUE.
  737.  
  738. WKSREAD$(file, row, col)
  739. Return string from row, col of .WKS file
  740. 0,0 is A1.  1,27 is AB2.
  741.  
  742. WKSREAD(file, row, col)
  743. Return number from row, col of .WKS file
  744. 0,0 is A1.  1,27 is AB2.
  745.  
  746. WKSTYPE(file, row, col)
  747. 1=EOF, 12=Blank, 13=Integer, 14=Real
  748. 15=Label (String), 16=Formula (Real)
  749. 0,0 is A1.  1,27 is AB2.
  750.  
  751. WRITE list of expressions
  752. Data is sperated by commas (,).
  753.  
  754. WRITE #fileno, list of expressions
  755. Data is send to a file, seperated by 
  756. commas (,).
  757. ə
  758.  
  759.